import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
       /* int count = 0;
        for (int i = 0; i <=100 ; i++) {
            if (i % 10 == 9 ) {
                count++;
            }
            if(i/10==9){
                count++;
            }
        }
        System.out.println(count);*/
        //编写程序数一下 1到 100 的所有整数中出现多少个数字9


        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        for (int i = 31; i >=1 ; i-=2) {
            System.out.print(num>>i&1);
        }
        System.out.println();
        for (int i = 30; i >=0 ; i-=2) {
            System.out.print(num>>i&1);
        }
    }
}